<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>审批详情</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no,email=no" />
		<link rel="stylesheet" href="../css/mui.min.css">			
		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
		<link rel="stylesheet" href="../fonts/iconfont.css" />
		<link rel="stylesheet" href="../css/OA.css" />
		
	</head>
	<body>
		<script src="../js/mui.min.js"></script>
		<script src="../js/mui.picker.min.js"></script>
		<script src="../js/app.js"></script>
		<script type="text/javascript" charset="utf-8">
			 //mui初始化 
			mui.init();
					
		</script>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title"><span id="name">xiaoyu</span>的<span id='examineType'></span></h1>
		</header>
		<div class="mui-content transparent">
			<div class="examine-head">
				<a href="javascript:;">
					<img class=" examine-img mui-pull-left" src="../images/toux.png">
					<div class="examine-state">
						
						<span class="" id='userName'></span><br>
						
						<span class="down" id='state'></span>
					</div> 
					<img src="" alt="" class="result-img" id="typeImg"/>
				</a>		
			</div>
			<ul class="mui-table-view" id='msg-list'>
				<!--<li class="mui-table-view-cell mui-media">										
					<span class="application-label">审批编号:</span><span>1234567</span>
				</li>
				<li class="mui-table-view-cell mui-media">										
					<span class="application-label" ><span id='examineType2'>加班</span>类型:</span><span id="type">晚上加班</span>
				</li>
				<li class="mui-table-view-cell mui-media">										
					<span class="application-label">开始时间:</span><span id="beginTime">2016-12-17 18:00</span>
				</li>
				<li class="mui-table-view-cell mui-media">										
					<span class="application-label">结束时间:</span><span id="overTime">2016-12-17 22:00</span>
				</li>
				<li class="mui-table-view-cell mui-media">										
					<span class="application-label">加班原因:</span><span id="reason">项目进度</span>
				</li>-->
			</ul>
			
		</div>
		
		
		<script>
			mui.plusReady(function() {
				var name=document.getElementById('name');
				var state=document.getElementById('state');
				var userName=document.getElementById('userName');
				var examineType=document.getElementById('examineType');
				var examineType2=document.getElementById('examineType2');
				var type=document.getElementById('type');
				var beginTime=document.getElementById('beginTime');
				var overTime=document.getElementById('overTime');
				var typeImg=document.getElementById('typeImg');
				var self = plus.webview.currentWebview();	
				var msg=document.getElementById('reason');
				var msgList=document.getElementById('msg-list');
				console.log(self.topicId); 
				var userId=plus.storage.getItem("userId")
				mui.ajax(url+'OA/GetAudingExamineInfo',{
						dataType:'json',
						data:{
							webToken:'rqlh',
							eventId:self.topicId,
							userId:userId
						},
						type:'get', 
						timeout:10000,
						success:function(data){	
							console.log(data.Msg);
							name.innerText=data.header.userName;
							userName.innerHTML=data.header.userName;
							console.log(data.header.examineType)
							examineType.innerText=data.header.examineType; 
//							examineType2.innerHTML=data.header.examineType;
							/*beginTime.innerHTML=data.Data[0].startTime;
							overTime.innerHTML=data.Data[0].endTime;*/
							state.innerHTML=data.header.status
							/*msg.innerHTML=data.Data[0].msg;*/
							if(data.header.status!='通过'){
								if(data.header.status='审批中'){
									typeImg.src='../images/spz.png'
								}else{
									typeImg.src='../images/spjj.png'
								}
								
							}else{
								typeImg.src='../images/sptg.png'
							}
							if(data.headerDetail){ 
								var html=''
								for(var i=0;i<data.headerDetail.length;i++){
									html+='<li class="mui-table-view-cell mui-media">'							
										+'<span class="application-label">'+data.headerDetail[i].displayName+':</span><span >'+data.headerDetail[i].values+'</span>'
										+'</li>'
								}
								/*在元素后面添加元素(内部)*/
//								msgList.insertAdjacentHTML("beforeend",html);
								msgList.innerHTML=html
							}
						},
						error:function(data){
							plus.nativeUI.toast("无法连接,请检查网络");
						}
			
				})
			})
		</script>
	</body>
</html>
